//
//  GongYeCell.m
//  Tire
//
//  Created by 王奎卿 on 2017/3/27.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "GongYeCell.h"

@implementation GongYeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.img];
        [self addSubview:self.title];
        [self addSubview:self.price];
        [self addSubview:self.xiaoliang];
        [self addSubview:self.renqi];
    }
    return self;
}

- (UIImageView *)img
{
    if (!_img)
    {
        _img = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 80, 80)];
        _img.backgroundColor = [UIColor yellowColor];
    }
    return _img;
}

- (UILabel *)title
{
    if (!_title)
    {
        CGSize size = [UIScreen mainScreen].bounds.size;
        _title = [[UILabel alloc]initWithFrame:CGRectMake(100, 10, size.width-100, 30)];
        _title.backgroundColor = [UIColor greenColor];
    }
    return _title;
}

- (UILabel *)price
{
    if (!_price)
    {
        _price = [[UILabel alloc]initWithFrame:CGRectMake(100, 50, 100, 30)];
        _price.backgroundColor = [UIColor redColor];
    }
    return _price;
}

- (UILabel *)xiaoliang
{
    if (!_xiaoliang)
    {
        _xiaoliang = [[UILabel alloc]initWithFrame:CGRectMake(100, 71, 100, 20)];
        _xiaoliang.backgroundColor = [UIColor grayColor];
    }
    return _xiaoliang;
}

- (UILabel *)renqi
{
    if (!_renqi)
    {
        CGSize size = [UIScreen mainScreen].bounds.size;
        _renqi = [[UILabel alloc]initWithFrame:CGRectMake(size.width-100, 71, 100, 20)];
        _renqi.backgroundColor = [UIColor purpleColor];
    }
    return _renqi;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
